//
//  AISetIconNameCell.m
//  Mia
//
//  Created by Vill on 2024/1/13.
//

#import "AISetIconNameCell.h"

@interface AISetIconNameCell ()

@property (weak, nonatomic) IBOutlet UIImageView *iconImg;

@property (weak, nonatomic) IBOutlet UILabel *nameLbl;

@end

@implementation AISetIconNameCell

+(instancetype)cellWithTableView:(UITableView *)tableView{
    static NSString *ID = @"AISetIconNameCell";
    AISetIconNameCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if(cell == nil){
       cell = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil].lastObject;
    }
    return cell;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.iconImg.contentMode = UIViewContentModeScaleAspectFill;
    self.iconImg.layer.cornerRadius = PTW(20);
    self.iconImg.layer.masksToBounds = YES;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    // Configure the view for the selected state
}

- (void)setIconImg:(NSString *)icon withName:(NSString *)nickName{
    [self.iconImg sd_setImageWithURL:KUrlImage(icon) placeholderImage:KImaged(@"")];
    self.nameLbl.text = nickName;
}

@end
